#include <stdio.h>

#define LENGTH 20

void function_1(char ee[], char ff[][LENGTH], char *gg, char *hh[],
				int num_rows_ff, int num_elems_hh);

/**
 * 将字符串传入用户自定义函数
 */
int main() {

	// 一维数组
	char aa[] = "One-dimensional array.";
	// 二维数组
	char bb[][LENGTH] = {"Two-", "dimensional ", "array."};
	// 指针变量
	char *cc = "Pointer to string constant.";
	// 指针数组
	char *dd[] = {"Array", "of pointers ", "to string ", "constants."};
	// 计算行数
	int num_rows_bb = sizeof(bb) / LENGTH,
	// 计算元素数
	num_elems_dd = sizeof(dd) / sizeof(char *);

	function_1(aa, bb, cc, dd, num_rows_bb, num_elems_dd);

}

void function_1(char ee[], char ff[][LENGTH], char *gg, char *hh[],
				int num_rows_ff, int num_elems_hh) {

	puts(ee);
	for (int i = 0; i < num_rows_ff; i++) {
		// puts 函数会添加换行符
		puts(ff[i]);
	}
	puts(gg);
	for (int i = 0; i < num_elems_hh; i++) {
		puts(hh[i]);
	}

}